﻿using Microsoft.SharePoint;

namespace TennisSite.EventReceivers
{
    public class PlayerItemEventReceiver : SPItemEventReceiver
    {
        public override void ItemDeleting(SPItemEventProperties properties)
        {
            if (!properties.UserLoginName.ToLower().Contains("admin"))
            {
                properties.Cancel = true;
                properties.ErrorMessage = "Tennis Player cannot be deleted.";
            }
        }
    }
}